package com.example.controller;

import com.example.service.LowCodeMappingSerive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(value = "api/lowCodeMapping")
public class LowCodeMappingController {

    @Autowired
    private LowCodeMappingSerive lowCodeMappingSerive;

    /**
     * 查询所有执法代码映射
     * @return
     */
    @RequestMapping(value = "/query" ,method = RequestMethod.POST)
    public Map<String,Object> query(){
        return lowCodeMappingSerive.queryAll();
    }

    /**
     * 根据代码查询对应的执法法规与处理措施 map中参数名称为 codes
     * @param map
     * @return
     */
    @RequestMapping(value = "/queryByCode" ,method = RequestMethod.POST)
    public Map<String,Object> queryByCode(Map map){
        return lowCodeMappingSerive.queryByCode(map);
    }
}
